<div id="content-container" class="container">
    <div class="row">
        <div class="col-md-3">
            {include file="common/user/sidenav" /}
        </div>
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-body">
                    <h2 class="page-header">{:__('My applet')}
                        <a href="{:url('applet/add')}" class="btn btn-info pull-right">
                            <span class="glyphicon glyphicon-plus"></span> {:__('Add')}
                        </a>
                    </h2>
                    {:token()}
                    <div>
                        <table class="table table-striped table-hover hm-table-list">
                            <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>头像</th>
                                    <th>名称</th>
                                    <th>类型</th>
                                    <th>关联模板</th>
                                    <th>二维码</th>
                                    <th>是否绑定</th>
                                    <th>时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                    <tr>
                                        <td>{$item.id}</td>
                                        <td>
                                            <img src="{$item.head_img?:'/assets/img/wxapp.png'}" />
                                        </td>
                                        <td>{$item.app_name?:'--'}</td>
                                        <td>{$item.type}</td>
                                        <td>{$item.version.template?:'--'}</td>
                                        <td>
                                            {if $item.qrcode_url}
                                            <a href="{$item.qrcode_url}" target="_blank">
                                                <img src="{$item.qrcode_url}" />
                                            </a>
                                            {else /}
                                                <img src="/assets/img/qrcode.png" />
                                            {/if}
                                        </td>
                                        <td>
                                            <h4>
                                                <span class="label {$item.status==1?'label-success':'label-warning'}">
                                                    {$item.status==1?'已绑定':'未绑定'}
                                                </span>
                                            <h4>
                                        </td>
                                        <td>{$item.createtime}</td>
                                        <td>
                                            <a href="{:url('applet/login',['applet_id'=>$item.id])}" target="_blank" class="btn btn-success btn-xs"> 
                                                <span class="glyphicon glyphicon-share-alt"></span> 登录
                                            </a>
                                        </td>
                                    </tr>
                                <?php endforeach; else: ?>
                                    <tr>
                                        <td colspan="9" class="text-center">暂无记录</td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="col-lg-12 clearfix">
                        <div class="pull-right"><?= $list->render() ?> </div>
                        <div class="pull-right">
                            <div class="">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
